package ar.com.tallerdos.smartdinner.business;

import java.util.List;

import ar.com.tallerdos.smartdinner.dao.BaseDao;
import ar.com.tallerdos.smartdinner.model.Identity;

public class GenericBusiness {

    private static BaseDao<? extends Identity> dao;
    
    public static Identity findById(Integer id) {
        return getDao().findById(id);
    }
    
    public static List<? extends Identity> findAll() {
        return getDao().findAll();
    }
    
    public static Boolean delete(Identity entity) {
        return delete(entity.getId());
    }
    
    public static Boolean delete(Integer id) {
        return getDao().delete(id);
    }
    
    public static BaseDao<? extends Identity> getDao() {
        return dao;
    }
    
    public static void setDao(BaseDao<? extends Identity> dao) {
	GenericBusiness.dao = dao;
    }
    
    

}
